From: Georges Basile Stavracas Neto Date: Fri, 11 Dec 2020 18:57:49 +0000 (-0300) Subject: workspacesView: Center workspaces of primary display X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~616^2^2~572 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=eb4f6740c3c8af8958b493563d571ee65a895865;p=gnome-shell.git workspacesView: Center workspaces of primary display Currently workspaces are left-aligned to the allocation, which looks odd after moving the Dash to the bottom. Allocate workspaces centered both horizontally and vertically. Part-of: --- diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js index c57129e50..865b52b50 100644 --- a/js/ui/workspacesView.js +++ b/js/ui/workspacesView.js @@ -114,14 +114,17 @@ class WorkspacesView extends WorkspacesViewBase { const vertical = workspaceManager.layout_rows === -1; const rtl = this.text_direction === Clutter.TextDirection.RTL; + const [width, height] = box.get_size(); + const childBox = box.copy(); + this._workspaces.forEach((child, index) => { if (rtl && !vertical) index = nWorkspaces - index - 1; - const x = vertical ? 0 : index * this.width; - const y = vertical ? index * this.height : 0; - - child.allocate_available_size(x, y, box.get_width(), box.get_height()); + childBox.set_origin( + vertical ? 0 : index * width, + vertical ? index * height : 0); + child.allocate_align_fill(childBox, 0.5, 0.5, false, false); }); this._updateScrollPosition();